// package-owner/pages/owner-join/index.js
import { ActivityMixins, PageShareMixins, PageListMixins } from '../../../behaviors/page';
import { getUserJoinActivityList } from '../../../api/usr';
const { showLoading, hideLoading } = require('../../../common/env');

Page({
    mixins: [ActivityMixins, PageShareMixins, PageListMixins],
    data: {
        activityList: [],
    },
    // 获取数据
    getListData: async function (isReplace=false) {
        showLoading('加载中...');
        const { pageNo, pageSize, pageTime, activityList } = this.data;
        const list = await getUserJoinActivityList({
            pageNo,
            pageSize,
            ts: pageTime,
        });
        this.setData({
            activityList: isReplace ? list : [...activityList, ...list],
        });
        hideLoading();
    },
})